
//复制这个方法 即可
export function getCurTime() {
  const date = new Date();
  return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() +" "+ `${date.getHours()}`.padStart(2,"0") + ':' + `${date.getMinutes()}`.padStart(2,"0")+':' +`${date.getSeconds()}`.padStart(2,"0");
}
export function isObject(obj){
  return typeof obj === 'object' && obj !== null
}
export function isEqual(obj1, obj2){
  if(!isObject(obj1) || !isObject(obj2)) {
    return obj1 === obj2
  }
  if(obj1 === obj2){
    return true
  }

  //obj1和obj2都是对象或者数组，且不相等
  //1.先取出obj1和obj2的keys，比较个数
  const obj1Keys = Object.keys(obj1)
  const obj2Keys = Object.keys(obj2)
  if(obj1Keys.length !== obj2Keys.length) {
    return false
  }
  //2.以obj1为基准，和obj2依次递归比较
  for (const key in obj1) {
    const res = isEqual(obj1[key], obj2[key])
    if(!res) {
      return false
    }
  }
  //3.全相等
  return true
}
